/*
 * Copyright (C) 拾光分享网 
 * All rights reserved, Designed By www.hiai.top.
 * Email：goodsking@163.com.
 */
package top.hiai._admin.permission;

import com.jfinal.plugin.activerecord.Page;

import top.hiai.common.model.Permission;
import top.hiai.config.BaseController;

/**
* @Author www.hiai.top
* @Email  goodsking@163.com
* @Message 更多资源尽在www.hiai.top
* @Introduction 类的介绍
*/

public class PermissionAdminController extends BaseController{

	PermissionAdminService srv = PermissionAdminService.me;

	public void index() {
		Page<Permission> permissionPage = srv.paginate(getParaToInt("p", 1),limtCount);
		srv.replaceControllerPrefix(permissionPage, "com.jfinal.club._admin.", "...");
		setAttr("permissionPage", permissionPage);
		render("permissionList.html");
	}
	/**
	 * 根据分类ID查找菜单
	 * 用户菜单的修改
	 */
	public void findById(){
		Permission permission = srv.findById(getParaToInt("id"));
		renderJson("result",permission);
	}
	
	
	/**
	 * 修改才散
	 */
	public void permissionEdit(){
		Boolean result = srv.permissionEdit(getInt("id"),get("remark"));
		renderJson("success",result);
	}
}